package com.cljz.peipei.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.widget.RadioButton;
import android.widget.RadioGroup;

import com.cljz.peipei.R;
import com.cljz.peipei.base.App;
import com.cljz.peipei.base.BaseActivity;

import butterknife.BindView;
import cn.droidlover.xdroidmvp.router.Router;

/**
 * Created by apple on 2017/4/18.
 */

public class SetSexActivity extends BaseActivity implements RadioGroup.OnCheckedChangeListener {


    @BindView(R.id.rb_girl)
    RadioButton rbGirl;
    @BindView(R.id.rb_boy)
    RadioButton rbBoy;
    @BindView(R.id.rg_sex)
    RadioGroup rgSex;
    private String sex;

    @Override
    public void initData(Bundle savedInstanceState) {

    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_set_sex;
    }

    @Override
    public Object newP() {
        return null;
    }

    @Override
    protected void initListener() {
        super.initListener();
        rgSex.setOnCheckedChangeListener(this);
    }

    @Override
    public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
        switch (checkedId) {
            case R.id.rb_girl:
                sex = "2";
                break;
            case R.id.rb_boy:
                sex = "1";
                break;
        }
        Router.newIntent((Activity) App.getInstance()).to(SetAgeActivity.class).putString("sex", sex).launch();
    }
}
